let name = "qq";
console.log(name);

import 'indSass';
import {A} from './person';
import '../css/iconfont.css';

let p1 = new A('lili');

console.log(p1.sayName());

// import img from '@/1.png';

function ajax(url,query){
    return new Promise((resolve,reject) => {
        let xhr = new XMLHttpRequest();

        url = query ? `${url}?${query}` : url;

        xhr.open('GET',url);

        xhr.send(null);

        xhr.onreadystatechange = () => {
            // reject(new Error('error'))
            if(xhr.readyState != 4)return;
            if(xhr.status === 200){
                resolve(xhr.responseText);
            }else{
                reject(new Error('error'))
            }
        }
    })
}

ajax('/api/list').then((res) => {
    console.log(res);
})

